package com.xuyoupeng.springframework.context.event;

import com.xuyoupeng.springframework.beans.factory.BeanFactory;
import com.xuyoupeng.springframework.context.ApplicationEvent;
import com.xuyoupeng.springframework.context.ApplicationListener;

/**
 * @author xuyoupneg
 * @description TODO
 * @date 2024/3/30 17:12
 */
public class SimpleApplicationEventMulticaster extends AbstractApplicationEventMulticaster{

    public SimpleApplicationEventMulticaster(BeanFactory beanFactory) {
        setBeanFactory(beanFactory);
    }
    @Override
    public void multicastEvent(ApplicationEvent event) {
        for (final ApplicationListener applicationListener : getApplicationListener(event)) {
            applicationListener.onApplicationEvent(event);
        }
    }
}
